import os
import sys

# 请在此输入您的代码

days = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

def count_days(start_x, start_y):
    week = 6  # 星期 0：星期日 1：星期1
    ans = 0
    # 遍历年份
    for y in range(start_x, start_y + 1):
        # 遍历月份
        for m in range(1, 13):
            dd = days[m]
            # 判断是否为闰年
            if (y % 4 == 0 and y % 100 != 0) or (y % 400 == 0):
                if m == 2:
                    dd + 1
            # 遍历天
            for d in range(1, dd + 1):
                # 满足条件 ans+1
                if week == 6 or week == 0 or d % 10 == 1:
                    ans += 1
                # 向后推移星期
                week = (week + 1) % 7

        return ans


# 起始年份，终止年份
start_y = 2022
start_x = 2022

print(count_days(start_x, start_y))